package com.zhentao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhentao.model.wemedia.pojo.WmNewsMaterial;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WmNewsMaterialMapper extends BaseMapper<WmNewsMaterial> {

    //绑定关系

    /**
     *
     * @param type
     * @param newsId
     * @param materialIds
     * @return
     *
     * 写了一篇文章  设置了3张封面
     * type  1
     * newsId  1
     * 素材id 1,2,3
     */
    Integer saveRelations(@Param("type")Short type,
                          @Param("newsId")Integer newsId,
                          @Param("materialIds") List<Integer> materialIds);

}